import hashlib
import random
import string


def gen_random_string(length=6):
    # 从字母和数字中随机选择字符
    random_string = ''.join(random.choices(
        string.ascii_letters + string.digits, k=length))
    return random_string

def gen_md5(value: str) -> str:
    md5_hash = hashlib.md5()
    md5_hash.update(value.encode("utf-8"))
    return md5_hash.hexdigest()